home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Headers / OLESTD.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  25.0 KB  |  711 lines  |  [TEXT/????]

  1. /*************************************************************************
  2. **
  3. **    OLE 2.0 Standard Utilities
  4. **
  5. **    olestd.h
  6. **
  7. **    This file contains file contains data structure defintions,
  8. **    function prototypes, constants, etc. for the common OLE 2.0
  9. **    utilities.
  10. **    These utilities include the following:
  11. **          Debuging Assert/Verify macros
  12. **          HIMETRIC conversion routines
  13. **          reference counting debug support
  14. **          OleStd API's for common compound-document app support
  15. **
  16. **    (c) Copyright Microsoft Corp. 1990 - 1994 All Rights Reserved
  17. **
  18. *************************************************************************/
  19.  
  20.  
  21. #ifndef _OLESTD_H_
  22. #define _OLESTD_H_
  23.  
  24.  
  25. #include <Dialogs.h>
  26. #include <Events.h>
  27.  
  28. #ifdef _DEBUG
  29. #include "uidebug.h"
  30. #endif
  31.  
  32.  
  33. //Hook type used in all structures.
  34. typedef unsigned int (*LPFNOLEUIHOOK)(DialogPtr, EventRecord *, short *, long);
  35.  
  36. // String table defines...
  37. #define  IDS_OLESTDNOCREATEFILE   700
  38. #define  IDS_OLESTDNOOPENFILE     701
  39. #define  IDS_OLESTDDISKFULL       702
  40.  
  41.  
  42. /*
  43.  * Some C interface declaration stuff
  44.  */
  45.  
  46. #if ! defined(__cplusplus)
  47. typedef struct tagINTERFACEIMPL {
  48.         IUnknownVtbl*            lpVtbl;
  49.         void*                   lpBack;
  50.         int                     cRef;   // interface specific ref count.
  51. } INTERFACEIMPL, *LPINTERFACEIMPL;
  52.  
  53. #define INIT_INTERFACEIMPL(lpIFace, pVtbl, pBack)   \
  54.         ((lpIFace)->lpVtbl = pVtbl, \
  55.             ((LPINTERFACEIMPL)(lpIFace))->lpBack = (void*)pBack,   \
  56.             ((LPINTERFACEIMPL)(lpIFace))->cRef = 0  \
  57.         )
  58.  
  59. #if defined( _DEBUG )
  60. #define OleDbgQueryInterfaceMethod(lpUnk)   \
  61.         ((lpUnk) != NULL ? ((LPINTERFACEIMPL)(lpUnk))->cRef++ : 0)
  62. #define OleDbgAddRefMethod(lpThis, iface)   \
  63.         ((LPINTERFACEIMPL)(lpThis))->cRef++
  64.  
  65. #if _DEBUGLEVEL >= 2
  66. #define OleDbgReleaseMethod(lpThis, iface) \
  67.         (--((LPINTERFACEIMPL)(lpThis))->cRef == 0 ? \
  68.             OleDbgOut("\t" iface "* RELEASED (cRef == 0)\n"),1 : \
  69.              (((LPINTERFACEIMPL)(lpThis))->cRef < 0) ? \
  70.                 ( \
  71.                     DebugBreak(), \
  72.                     OleDbgOut(  \
  73.                         "\tERROR: " iface "* RELEASED TOO MANY TIMES\n") \
  74.                 ),1 : \
  75.                 1)
  76.  
  77. #else       // if _DEBUGLEVEL < 2
  78. #define OleDbgReleaseMethod(lpThis, iface) \
  79.         (--((LPINTERFACEIMPL)(lpThis))->cRef == 0 ? \
  80.             1 : \
  81.              (((LPINTERFACEIMPL)(lpThis))->cRef < 0) ? \
  82.                 ( \
  83.                     OleDbgOut(  \
  84.                         "\tERROR: " iface "* RELEASED TOO MANY TIMES\n") \
  85.         ),1 : \
  86.                 1)
  87.  
  88. #endif      // if _DEBUGLEVEL < 2
  89.  
  90. #else       // ! defined (_DEBUG)
  91.  
  92. #define OleDbgQueryInterfaceMethod(lpUnk)
  93. #define OleDbgAddRefMethod(lpThis, iface)
  94. #define OleDbgReleaseMethod(lpThis, iface)
  95.  
  96. #endif      // if defined( _DEBUG )
  97.  
  98. #endif      // ! defined(__cplusplus)
  99.  
  100. /*
  101.  * Some docfiles stuff
  102.  */
  103.  
  104. #define STGM_DFRALL (STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_DENY_WRITE)
  105. #define STGM_DFALL (STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_EXCLUSIVE)
  106. #define STGM_SALL (STGM_READWRITE | STGM_SHARE_EXCLUSIVE)
  107.  
  108. /*
  109.  * Some moniker stuff
  110.  */
  111.  
  112. // Delimeter used to separate ItemMoniker pieces of a composite moniker
  113. #if defined( _MAC )
  114. #define OLESTDDELIM ":"
  115. #else
  116. #define OLESTDDELIM "\\"
  117. #endif
  118.  
  119. /*
  120.  * Some Concurrency stuff
  121.  */
  122.  
  123. /* standard Delay (in 60th secs) to wait before retrying an LRPC call.
  124. **    this value is returned from IMessageFilter::RetryRejectedCall
  125. */
  126. #define OLESTDRETRYDELAY    (unsigned long)900
  127.  
  128. /* Cancel the pending outgoing LRPC call.
  129. **    this value is returned from IMessageFilter::RetryRejectedCall
  130. */
  131. #define OLESTDCANCELRETRY   (unsigned long)-1
  132.  
  133. /*
  134.  * Some Clipboard Copy/Paste & Drag/Drop support stuff
  135.  */
  136.  
  137. //Macro to set all FormatEtc fields
  138. #define SETFORMATETC(fe, cf, asp, td, med, li)   \
  139.     ((fe).cfFormat=cf, \
  140.      (fe).dwAspect=asp, \
  141.      (fe).ptd=td, \
  142.      (fe).tymed=med, \
  143.      (fe).lindex=li)
  144.  
  145. //Macro to set interesting FormatEtc fields defaulting the others.
  146. #define SETDEFAULTFORMATETC(fe, cf, med)  \
  147.     ((fe).cfFormat=cf, \
  148.      (fe).dwAspect=DVASPECT_CONTENT, \
  149.      (fe).ptd=NULL, \
  150.      (fe).tymed=med, \
  151.      (fe).lindex=-1)
  152.  
  153. // Macro to test if two FormatEtc structures match
  154. #define IsEqualFORMATETC(fe1, fe2)  \
  155.     ((fe1).cfFormat == (fe2).cfFormat \
  156.      && ((fe1).tymed & (fe2).tymed) \
  157.      && (!(fe1).dwAspect||!(fe2).dwAspect||((fe1).dwAspect&(fe2).dwAspect)) \
  158.      && (fe1).ptd == (fe2).ptd)
  159.  
  160. #ifdef __UNUSED__
  161. // Clipboard format strings
  162. #define CF_EMBEDSOURCE      "Embed Source"
  163. #define CF_EMBEDDEDOBJECT   "Embedded Object"
  164. #define CF_LINKSOURCE       "Link Source"
  165. #define CF_OBJECTDESCRIPTOR "Object Descriptor"
  166. #define CF_LINKSRCDESCRIPTOR "Link Source Descriptor"
  167. #define CF_OWNERLINK        "OwnerLink"
  168. #define CF_FILENAME         "FileName"
  169. #endif
  170.  
  171. /* The OLEUIPASTEFLAG enumeration is used by the OLEUIPASTEENTRY structure.
  172.  *
  173.  * OLEUIPASTE_ENABLEICON    If the container does not specify this flag for the entry in the
  174.  *   OLEUIPASTEENTRY array passed as input to OleUIPasteSpecial, the DisplayAsIcon button will be
  175.  *   unchecked and disabled when the the user selects the format that corresponds to the entry.
  176.  *
  177.  * OLEUIPASTE_PASTEONLY     Indicates that the entry in the OLEUIPASTEENTRY array is valid for pasting only.
  178.  * OLEUIPASTE_PASTE         Indicates that the entry in the OLEUIPASTEENTRY array is valid for pasting. It
  179.  *   may also be valid for linking if any of the following linking flags are specified.
  180.  *
  181.  * If the entry in the OLEUIPASTEENTRY array is valid for linking, the following flags indicate which link
  182.  * types are acceptable by OR'ing together the appropriate OLEUIPASTE_LINKTYPE<#> values.
  183.  * These values correspond as follows to the array of link types passed to OleUIPasteSpecial:
  184.  *   OLEUIPASTE_LINKTYPE1=arrLinkTypes[0]
  185.  *   OLEUIPASTE_LINKTYPE2=arrLinkTypes[1]
  186.  *   OLEUIPASTE_LINKTYPE3=arrLinkTypes[2]
  187.  *   OLEUIPASTE_LINKTYPE4=arrLinkTypes[3]
  188.  *   OLEUIPASTE_LINKTYPE5=arrLinkTypes[4]
  189.  *   OLEUIPASTE_LINKTYPE6=arrLinkTypes[5]
  190.  *   OLEUIPASTE_LINKTYPE7=arrLinkTypes[6]
  191.  *  OLEUIPASTE_LINKTYPE8=arrLinkTypes[7]
  192.  *
  193.  * where,
  194.  *   unsigned int arrLinkTypes[8] is an array of registered clipboard formats for linking. A maximium of 8 link
  195.  *   types are allowed.
  196.  */
  197.  
  198. typedef enum tagOLEUIPASTEFLAG
  199. {
  200.    OLEUIPASTE_ENABLEICON    = 2048,     // enable display as icon
  201.    OLEUIPASTE_PASTEONLY     = 0,
  202.    OLEUIPASTE_PASTE         = 512,
  203.    OLEUIPASTE_LINKANYTYPE   = 1024,
  204.    OLEUIPASTE_LINKTYPE1     = 1,
  205.    OLEUIPASTE_LINKTYPE2     = 2,
  206.    OLEUIPASTE_LINKTYPE3     = 4,
  207.    OLEUIPASTE_LINKTYPE4     = 8,
  208.    OLEUIPASTE_LINKTYPE5     = 16,
  209.    OLEUIPASTE_LINKTYPE6     = 32,
  210.    OLEUIPASTE_LINKTYPE7     = 64,
  211.    OLEUIPASTE_LINKTYPE8     = 128
  212. } OLEUIPASTEFLAG;
  213.  
  214. /*
  215.  * PasteEntry structure
  216.  * --------------------
  217.  * An array of OLEUIPASTEENTRY entries is specified for the PasteSpecial dialog
  218.  * box. Each entry includes a FORMATETC which specifies the formats that are
  219.  * acceptable, a string that is to represent the format in the  dialog's list
  220.  * box, a string to customize the result text of the dialog and a set of flags
  221.  * from the OLEUIPASTEFLAG enumeration.  The flags indicate if the entry is
  222.  * valid for pasting only, linking only or both pasting and linking. If the
  223.  * entry is valid for linking, the flags indicate which link types are
  224.  * acceptable by OR'ing together the appropriate OLEUIPASTE_LINKTYPE<#> values.
  225.  * These values correspond to the array of link types as follows:
  226.  *   OLEUIPASTE_LINKTYPE1=arrLinkTypes[0]
  227.  *   OLEUIPASTE_LINKTYPE2=arrLinkTypes[1]
  228.  *   OLEUIPASTE_LINKTYPE3=arrLinkTypes[2]
  229.  *   OLEUIPASTE_LINKTYPE4=arrLinkTypes[3]
  230.  *   OLEUIPASTE_LINKTYPE5=arrLinkTypes[4]
  231.  *   OLEUIPASTE_LINKTYPE6=arrLinkTypes[5]
  232.  *   OLEUIPASTE_LINKTYPE7=arrLinkTypes[6]
  233.  *   OLEUIPASTE_LINKTYPE8=arrLinkTypes[7]
  234.  *   unsigned int arrLinkTypes[8]; is an array of registered clipboard formats
  235.  *                        for linking. A maximium of 8 link types are allowed.
  236.  */
  237.  
  238. typedef struct tagOLEUIPASTEENTRY
  239. {
  240.    FORMATETC        fmtetc;            // Format that is acceptable. The paste
  241.                                        //   dialog checks if this format is
  242.                                        //   offered by the object on the
  243.                                        //   clipboard and if so offers it for
  244.                                        //   selection to the user.
  245.    const char*      lpstrFormatName;   // String that represents the format to the user. Any %s
  246.                                        //   in this string is replaced by the FullUserTypeName
  247.                                        //   of the object on the clipboard and the resulting string
  248.                                        //   is placed in the list box of the dialog. Atmost
  249.                                        //   one %s is allowed. The presence or absence of %s indicates
  250.                                        //   if the result text is to indicate that data is
  251.                                        //   being pasted or that an object that can be activated by
  252.                                        //   an application is being pasted. If %s is
  253.                                        //   present, the result-text says that an object is being pasted.
  254.                                        //   Otherwise it says that data is being pasted.
  255.    const char*      lpstrResultText;   // String to customize the result text of the dialog when
  256.                                        //  the user selects the format correspoding to this
  257.                                        //  entry. Any %s in this string is replaced by the the application
  258.                                        //  name or FullUserTypeName of the object on
  259.                                        //  the clipboard. Atmost one %s is allowed.
  260.    unsigned long    dwFlags;           // Values from OLEUIPASTEFLAG enum
  261.    unsigned long    dwScratchSpace;    // Scratch space available to be used
  262.                                        //   by routines which loop through an
  263.                                        //   IEnumFORMATETC* to mark if the
  264.                                        //   PasteEntry format is available.
  265.                                        //   this field CAN be left uninitialized.
  266. } OLEUIPASTEENTRY, *POLEUIPASTEENTRY, *LPOLEUIPASTEENTRY;
  267.  
  268. #define OLESTDDROP_NONE         0
  269. #define OLESTDDROP_DEFAULT      1
  270. #define OLESTDDROP_NONDEFAULT   2
  271.  
  272.  
  273. #ifdef __UNUSED__
  274.  
  275. /*
  276.  * Some misc stuff
  277.  */
  278.  
  279. #define EMBEDDINGFLAG "Embedding"     // Cmd line switch for launching a srvr
  280.  
  281. #define HIMETRIC_PER_INCH   2540      // number HIMETRIC units per inch
  282. #define PTS_PER_INCH        72        // number points (font size) per inch
  283.  
  284. #define MAP_PIX_TO_LOGHIM(x,ppli)   MulDiv(HIMETRIC_PER_INCH, (x), (ppli))
  285. #define MAP_LOGHIM_TO_PIX(x,ppli)   MulDiv((ppli), (x), HIMETRIC_PER_INCH)
  286.  
  287. #endif
  288.  
  289.  
  290. /****** DEBUG Stuff *****************************************************/
  291.  
  292. #ifdef _DEBUG
  293.  
  294. #if !defined( _DBGTRACE )
  295. #define _DEBUGLEVEL 2
  296. #else
  297. #define _DEBUGLEVEL _DBGTRACE
  298. #endif
  299.  
  300. #if !defined( _DEBUG )
  301.  
  302. #if !defined(_OLE_ASSERTS)
  303. #define ASSERTDATA
  304. #endif
  305.  
  306. #define OLEDBGASSERTDATA
  307. #define OleDbgAssert(a)
  308. #define OleDbgAssertSz(a, b)
  309. #define OleDbgVerify(a)
  310. #define OleDbgVerifySz(a, b)
  311.  
  312. #else   // ! NOASSERT
  313.  
  314. #if !defined(_OLE_ASSERTS)
  315. #define ASSERTDATA            static char _szAssertFile[]=__FILE__;
  316. #define Assert(a)        { if (!(a)) __UIASSERTCONDSZ(#a, NULL, _szAssertFile, __LINE__); }
  317. #define AssertSz(a, b)    { if (!(a)) __UIASSERTCONDSZ(#a, b, _szAssertFile, __LINE__); }
  318. #endif
  319.  
  320. #define OLEDBGASSERTDATA    ASSERTDATA
  321.  
  322. #define OleDbgAssert    Assert
  323.  
  324. #define OleDbgAssertSz  AssertSz
  325.  
  326. #define OleDbgVerify(a) \
  327.         OleDbgAssert(a)
  328.  
  329. #define OleDbgVerifySz(a, b)    \
  330.         OleDbgAssertSz(a, b)
  331.  
  332. #endif  // ! NOASSERT
  333.  
  334.  
  335. #define OLEDBGDATA_MAIN(szPrefix)   \
  336.         char  *g_szDbgPrefix = szPrefix;    \
  337.         OLEDBGASSERTDATA
  338.  
  339. #define OLEDBGDATA  \
  340.         extern char *g_szDbgPrefix;    \
  341.         OLEDBGASSERTDATA
  342.  
  343. #define OLEDBG_BEGIN(lpsz) \
  344.         OleDbgPrintAlways(g_szDbgPrefix,lpsz,1);
  345.  
  346. #define OLEDBG_END  \
  347.         OleDbgPrintAlways(g_szDbgPrefix,"End\n",-1);
  348.  
  349. #define OleDbgOut(lpsz) \
  350.         OleDbgPrintAlways(g_szDbgPrefix,lpsz,0)
  351.  
  352. #define OleDbgOutNoPrefix(lpsz) \
  353.         OleDbgPrint("",lpsz,0)
  354.  
  355. #define OleDbgOutRefCnt(lpsz,lpObj,refcnt)      \
  356.         OleDbgPrintRefCntAlways(g_szDbgPrefix,lpsz,lpObj,(unsigned long)refcnt)
  357.  
  358. #define OleDbgOutRect(lpsz,lpRect)      \
  359.         OleDbgPrintRectAlways(g_szDbgPrefix,lpsz,lpRect)
  360.  
  361. #define OleDbgOutHResult(lpsz,hr)   \
  362.         OleDbgPrintScodeAlways(g_szDbgPrefix,lpsz,GetScode(hr))
  363.  
  364. #define OleDbgOutScode(lpsz,sc) \
  365.         OleDbgPrintScodeAlways(g_szDbgPrefix,lpsz,sc)
  366.  
  367. #define OleDbgOut1(lpsz)    \
  368.         OleDbgPrint(1,g_szDbgPrefix,lpsz,0)
  369.  
  370. #define OleDbgOutNoPrefix1(lpsz)    \
  371.         OleDbgPrint(1,"",lpsz,0)
  372.  
  373. #define OLEDBG_BEGIN1(lpsz)    \
  374.         OleDbgPrint(1,g_szDbgPrefix,lpsz,1);
  375.  
  376. #define OLEDBG_END1 \
  377.         OleDbgPrint(1,g_szDbgPrefix,"End\n",-1);
  378.  
  379. #define OleDbgOutRefCnt1(lpsz,lpObj,refcnt)     \
  380.         OleDbgPrintRefCnt(1,g_szDbgPrefix,lpsz,lpObj,(unsigned long)refcnt)
  381.  
  382. #define OleDbgOutRect1(lpsz,lpRect)     \
  383.         OleDbgPrintRect(1,g_szDbgPrefix,lpsz,lpRect)
  384.  
  385. #define OleDbgOut2(lpsz)    \
  386.         OleDbgPrint(2,g_szDbgPrefix,lpsz,0)
  387.  
  388. #define OleDbgOutNoPrefix2(lpsz)    \
  389.         OleDbgPrint(2,"",lpsz,0)
  390.  
  391. #define OLEDBG_BEGIN2(lpsz)    \
  392.         OleDbgPrint(2,g_szDbgPrefix,lpsz,1);
  393.  
  394. #define OLEDBG_END2 \
  395.         OleDbgPrint(2,g_szDbgPrefix,"End\n",-1);
  396.  
  397. #define OleDbgOutRefCnt2(lpsz,lpObj,refcnt)     \
  398.         OleDbgPrintRefCnt(2,g_szDbgPrefix,lpsz,lpObj,(unsigned long)refcnt)
  399.  
  400. #define OleDbgOutRect2(lpsz,lpRect)     \
  401.         OleDbgPrintRect(2,g_szDbgPrefix,lpsz,lpRect)
  402.  
  403. #define OleDbgOut3(lpsz)    \
  404.         OleDbgPrint(3,g_szDbgPrefix,lpsz,0)
  405.  
  406. #define OleDbgOutNoPrefix3(lpsz)    \
  407.         OleDbgPrint(3,"",lpsz,0)
  408.  
  409. #define OLEDBG_BEGIN3(lpsz)    \
  410.         OleDbgPrint(3,g_szDbgPrefix,lpsz,1);
  411.  
  412. #define OLEDBG_END3 \
  413.         OleDbgPrint(3,g_szDbgPrefix,"End\n",-1);
  414.  
  415. #define OleDbgOutRefCnt3(lpsz,lpObj,refcnt)     \
  416.         OleDbgPrintRefCnt(3,g_szDbgPrefix,lpsz,lpObj,(unsigned long)refcnt)
  417.  
  418. #define OleDbgOutRect3(lpsz,lpRect)     \
  419.         OleDbgPrintRect(3,g_szDbgPrefix,lpsz,lpRect)
  420.  
  421. #define OleDbgOut4(lpsz)    \
  422.         OleDbgPrint(4,g_szDbgPrefix,lpsz,0)
  423.  
  424. #define OleDbgOutNoPrefix4(lpsz)    \
  425.         OleDbgPrint(4,"",lpsz,0)
  426.  
  427. #define OLEDBG_BEGIN4(lpsz)    \
  428.         OleDbgPrint(4,g_szDbgPrefix,lpsz,1);
  429.  
  430. #define OLEDBG_END4 \
  431.         OleDbgPrint(4,g_szDbgPrefix,"End\n",-1);
  432.  
  433. #define OleDbgOutRefCnt4(lpsz,lpObj,refcnt)     \
  434.         OleDbgPrintRefCnt(4,g_szDbgPrefix,lpsz,lpObj,(unsigned long)refcnt)
  435.  
  436. #define OleDbgOutRect4(lpsz,lpRect)     \
  437.         OleDbgPrintRect(4,g_szDbgPrefix,lpsz,lpRect)
  438.  
  439. #else   //  !_DEBUG
  440.  
  441. #define OLEDBGDATA_MAIN(szPrefix)
  442. #define OLEDBGDATA
  443. #define OleDbgAssert(a)
  444. #define OleDbgAssertSz(a, b)
  445. #define OleDbgVerify(a)         (a)
  446. #define OleDbgVerifySz(a, b)    (a)
  447. #define OleDbgOutHResult(lpsz,hr)
  448. #define OleDbgOutScode(lpsz,sc)
  449. #define OLEDBG_BEGIN
  450. #define OLEDBG_END
  451. #define OleDbgOut(lpsz)
  452. #define OleDbgOut1(lpsz)
  453. #define OleDbgOut2(lpsz)
  454. #define OleDbgOut3(lpsz)
  455. #define OleDbgOut4(lpsz)
  456. #define OleDbgOutNoPrefix(lpsz)
  457. #define OleDbgOutNoPrefix1(lpsz)
  458. #define OleDbgOutNoPrefix2(lpsz)
  459. #define OleDbgOutNoPrefix3(lpsz)
  460. #define OleDbgOutNoPrefix4(lpsz)
  461. #define OLEDBG_BEGIN1(lpsz)
  462. #define OLEDBG_BEGIN2(lpsz)
  463. #define OLEDBG_BEGIN3(lpsz)
  464. #define OLEDBG_BEGIN4(lpsz)
  465. #define OLEDBG_END1
  466. #define OLEDBG_END2
  467. #define OLEDBG_END3
  468. #define OLEDBG_END4
  469. #define OleDbgOutRefCnt(lpsz,lpObj,refcnt)
  470. #define OleDbgOutRefCnt1(lpsz,lpObj,refcnt)
  471. #define OleDbgOutRefCnt2(lpsz,lpObj,refcnt)
  472. #define OleDbgOutRefCnt3(lpsz,lpObj,refcnt)
  473. #define OleDbgOutRefCnt4(lpsz,lpObj,refcnt)
  474. #define OleDbgOutRect(lpsz,lpRect)
  475. #define OleDbgOutRect1(lpsz,lpRect)
  476. #define OleDbgOutRect2(lpsz,lpRect)
  477. #define OleDbgOutRect3(lpsz,lpRect)
  478. #define OleDbgOutRect4(lpsz,lpRect)
  479.  
  480. #endif  //  _DEBUG
  481.  
  482.  
  483. //Function prototypes
  484.  
  485. //OLESTD.C
  486. STDAPI_(int) SetDCToAnisotropic(WindowPtr hDC, Rect* lprcPhysical, Rect* lprcLogical, Rect* lprcWindowOld, Rect* lprcViewportOld);
  487. STDAPI_(int) SetDCToDrawInHimetricRect(WindowPtr, Rect*, Rect*, Rect*, Rect*);
  488. STDAPI_(int) ResetOrigDC(WindowPtr, int, Rect*, Rect*);
  489.  
  490. STDAPI_(void) XformRectInPixelsToHimetric(WindowPtr, Rect*, Rect*);
  491. STDAPI_(void) XformRectInHimetricToPixels(WindowPtr, Rect*, Rect*);
  492. STDAPI_(void) XformSizeInPixelsToHimetric(WindowPtr, LPSIZEL, LPSIZEL);
  493. STDAPI_(void) XformSizeInHimetricToPixels(WindowPtr, LPSIZEL, LPSIZEL);
  494. STDAPI_(int) XformWidthInHimetricToPixels(WindowPtr, int);
  495. STDAPI_(int) XformWidthInPixelsToHimetric(WindowPtr, int);
  496. STDAPI_(int) XformHeightInHimetricToPixels(WindowPtr, int);
  497. STDAPI_(int) XformHeightInPixelsToHimetric(WindowPtr, int);
  498. STDAPI_(unsigned long) AreRectsEqual(Rect* lprc1, Rect* lprc2);
  499.  
  500.  
  501. STDAPI_(void) ParseCmdLine(char*, unsigned long *, char*);
  502.  
  503. STDAPI_(unsigned long) OleStdIsOleLink(LPUNKNOWN lpUnk);
  504. STDAPI_(LPUNKNOWN) OleStdQueryInterface(LPUNKNOWN lpUnk, REFIID riid);
  505. STDAPI_(LPSTORAGE) OleStdCreateRootStorage(char* lpszStgName, unsigned long grfMode);
  506. STDAPI_(LPSTORAGE) OleStdOpenRootStorage(char* lpszStgName, unsigned long grfMode);
  507. STDAPI_(LPSTORAGE) OleStdOpenOrCreateRootStorage(char* lpszStgName, unsigned long grfMode);
  508. STDAPI_(LPSTORAGE) OleStdCreateChildStorage(LPSTORAGE lpStg, char* lpszStgName);
  509. STDAPI_(LPSTORAGE) OleStdOpenChildStorage(LPSTORAGE lpStg, char* lpszStgName, unsigned long grfMode);
  510. STDAPI_(unsigned long) OleStdCommitStorage(LPSTORAGE lpStg);
  511.  
  512. STDAPI_(LPSTORAGE) OleStdCreateStorageOnHGlobal(
  513.         Handle hGlobal,
  514.         unsigned long fDeleteOnRelease,
  515.         unsigned long dwgrfMode
  516. );
  517. STDAPI_(LPSTORAGE) OleStdCreateTempStorage(unsigned long fUseMemory, unsigned long grfMode);
  518. STDAPI OleStdDoConvert(LPSTORAGE lpStg, REFCLSID rClsidNew);
  519. STDAPI_(unsigned long) OleStdGetTreatAsFmtUserType(
  520.         REFCLSID        rClsidApp,
  521.         LPSTORAGE       lpStg,
  522.         CLSID*      lpclsid,
  523.         ResType* lpcfFmt,
  524.         char**      lplpszType
  525. );
  526. STDAPI OleStdDoTreatAsClass(char* lpszUserType, REFCLSID rclsid, REFCLSID rclsidNew);
  527. STDAPI_(unsigned long) OleStdSetupAdvises(LPOLEOBJECT lpOleObject, unsigned long dwDrawAspect,
  528.                     char* lpszContainerApp, char* lpszContainerObj,
  529.                     LPADVISESINK lpAdviseSink);
  530. STDAPI OleStdSwitchDisplayAspect(
  531.         LPOLEOBJECT             lpOleObj,
  532.         unsigned long*          lpdwCurAspect,
  533.         unsigned long           dwNewAspect,
  534.         PicHandle               hMetaPict,
  535.         unsigned long           fDeleteOldAspect,
  536.         unsigned long           fSetupViewAdvise,
  537.         LPADVISESINK            lpAdviseSink,
  538.         Boolean*                lpfMustUpdate
  539. );
  540. STDAPI OleStdSetIconInCache(LPOLEOBJECT lpOleObj, PicHandle hMetaPict);
  541. STDAPI_(Handle) OleStdGetData(
  542.         LPDATAOBJECT        lpDataObj,
  543.         ResType          cfFormat,
  544.         DVTARGETDEVICE* lpTargetDevice,
  545.         unsigned long               dwAspect,
  546.         LPSTGMEDIUM         lpMedium
  547. );
  548. STDAPI_(void) OleStdMarkPasteEntryList(
  549.         LPDATAOBJECT        lpSrcDataObj,
  550.         LPOLEUIPASTEENTRY   lpPriorityList,
  551.         int                 cEntries
  552. );
  553. STDAPI_(int) OleStdGetPriorityClipboardFormat(
  554.         LPDATAOBJECT        lpSrcDataObj,
  555.         LPOLEUIPASTEENTRY   lpPriorityList,
  556.         int                 cEntries
  557. );
  558. STDAPI_(unsigned long) OleStdIsDuplicateFormat(
  559.         LPFORMATETC         lpFmtEtc,
  560.         LPFORMATETC         arrFmtEtc,
  561.         int                 nFmtEtc
  562. );
  563. STDAPI_(void) OleStdRegisterAsRunning(LPUNKNOWN lpUnk, LPMONIKER lpmkFull, unsigned long* lpdwRegister);
  564. STDAPI_(void) OleStdRevokeAsRunning(unsigned long* lpdwRegister);
  565. STDAPI_(void) OleStdNoteFileChangeTime(char* lpszFileName, unsigned long dwRegister);
  566. STDAPI_(void) OleStdNoteObjectChangeTime(unsigned long dwRegister);
  567. STDAPI OleStdGetOleObjectData(
  568.         LPPERSISTSTORAGE    lpPStg,
  569.         LPFORMATETC         lpformatetc,
  570.         LPSTGMEDIUM         lpMedium,
  571.         unsigned long                fUseMemory
  572. );
  573. STDAPI OleStdGetLinkSourceData(
  574.         LPMONIKER           lpmk,
  575.         LPCLSID             lpClsID,
  576.         LPFORMATETC         lpformatetc,
  577.         LPSTGMEDIUM         lpMedium
  578. );
  579. STDAPI_(Handle) OleStdGetObjectDescriptorData(
  580.         CLSID               clsid,
  581.         unsigned long               dwAspect,
  582.         SIZEL               sizel,
  583.         POINTL              pointl,
  584.         unsigned long               dwStatus,
  585.         char*               lpszFullUserTypeName,
  586.         char*               lpszSrcOfCopy
  587. );
  588. STDAPI_(Handle) OleStdGetObjectDescriptorDataFromOleObject(
  589.         LPOLEOBJECT         lpOleObj,
  590.         char*               lpszSrcOfCopy,
  591.         unsigned long               dwAspect,
  592.         POINTL              pointl
  593. );
  594. STDAPI_(Handle) OleStdFillObjectDescriptorFromData(
  595.         LPDATAOBJECT       lpDataObject,
  596.         LPSTGMEDIUM        lpmedium,
  597.         ResType*    lpcfFmt
  598. );
  599. STDAPI_(unsigned long) OleStdCopyMetafilePict(Handle hpictin, Handle* phpictout);
  600. STDAPI_(Handle) OleStdGetMetafilePictFromOleObject(
  601.         LPOLEOBJECT         lpOleObj,
  602.         unsigned long               dwDrawAspect
  603. );
  604. STDAPI OleStdQueryOleObjectData(LPFORMATETC lpformatetc);
  605. STDAPI OleStdQueryLinkSourceData(LPFORMATETC lpformatetc);
  606. STDAPI OleStdQueryObjectDescriptorData(LPFORMATETC lpformatetc);
  607. STDAPI OleStdQueryFormatMedium(LPFORMATETC lpformatetc, TYMED tymed);
  608. STDAPI_(void) OleStdCreateTempFileMoniker(FSSpecPtr pPrefixFSP, unsigned int* lpuUnique, LPMONIKER* lplpmk);
  609. STDAPI_(LPMONIKER) OleStdGetFirstMoniker(LPMONIKER lpmk);
  610. STDAPI_(unsigned long) OleStdGetLenFilePrefixOfMoniker(LPMONIKER lpmk);
  611. STDAPI_(void*) OleStdMalloc(unsigned long ulSize);
  612. STDAPI_(void*) OleStdRealloc(void* pmem, unsigned long ulSize);
  613. STDAPI_(void) OleStdFree(void* pmem);
  614. STDAPI_(unsigned long) OleStdGetSize(void* pmem);
  615. STDAPI_(void) OleStdFreeString(char* lpsz, LPMALLOC lpMalloc);
  616. STDAPI_(char*) OleStdCopyString(char* lpszSrc, LPMALLOC lpMalloc);
  617. STDAPI_(unsigned long) OleStdGetItemToken(char* lpszSrc, char* lpszDst, int nMaxChars);
  618.  
  619. STDAPI_(void*) OleStdMemSet(void* pDest, int c, size_t count);
  620.  
  621. STDAPI_(void) OleStdInitVtbl(void* lpVtbl, unsigned int nSizeOfVtbl);
  622. STDMETHODIMP OleStdNullMethod(LPUNKNOWN lpThis);
  623. STDAPI_(unsigned long) OleStdCheckVtbl(void* lpVtbl, unsigned int nSizeOfVtbl, char* lpszIface);
  624. // STDAPI_(unsigned long) OleStdVerifyRelease(LPUNKNOWN lpUnk, char* lpszMsg);
  625. STDAPI_(unsigned long) OleStdVerifyRelease(LPUNKNOWN lpUnk);
  626. STDAPI_(unsigned long) OleStdRelease(LPUNKNOWN lpUnk);
  627.  
  628. STDAPI_(WindowPtr) OleStdCreateDC(DVTARGETDEVICE* ptd);
  629. STDAPI_(WindowPtr) OleStdCreateIC(DVTARGETDEVICE* ptd);
  630. // STDAPI_(DVTARGETDEVICE*) OleStdCreateTargetDevice(LPPRINTDLG lpPrintDlg);
  631. STDAPI_(unsigned long) OleStdDeleteTargetDevice(DVTARGETDEVICE* ptd);
  632. STDAPI_(DVTARGETDEVICE *) OleStdCopyTargetDevice(DVTARGETDEVICE* ptdSrc);
  633. STDAPI_(unsigned long) OleStdCopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc);
  634.  
  635. /*
  636.  * Functions prototypes used in geticon.c
  637.  */
  638. STDAPI_(unsigned long) OleStdGetUserTypeOfClass(REFCLSID rclsid, char *lpszUserType, unsigned int cch, HKEY hKey);
  639. STDAPI_(unsigned long) OleStdGetAuxUserType(REFCLSID rclsid, short wAuxUserType,  char *lpszAuxUserType,
  640.                                       int cch, HKEY hKey);
  641. /*
  642.  * Functions prototypes used in enumfetc.c
  643.  */
  644. STDAPI_(void) EnumFORMATETCInitInterface(void);
  645. STDAPI_(LPENUMFORMATETC) OleStdEnumFmtEtc_Create(unsigned short wCount, LPFORMATETC lpEtc);
  646.  
  647.  
  648. STDAPI_(void) OleDbgPrint(
  649.         int     nDbgLvl,
  650.         char*   lpszPrefix,
  651.         char*   lpszMsg,
  652.         int     nIndent
  653. );
  654. STDAPI_(void) OleDbgPrintAlways(char* lpszPrefix, char* lpszMsg, int nIndent);
  655. STDAPI_(void) OleDbgSetDbgLevel(int nDbgLvl);
  656. STDAPI_(int) OleDbgGetDbgLevel( void );
  657. STDAPI_(void) OleDbgIndent(int n);
  658. STDAPI_(void) OleDbgPrintRefCnt(
  659.         int         nDbgLvl,
  660.         char*       lpszPrefix,
  661.         char*       lpszMsg,
  662.         void*      lpObj,
  663.         unsigned long       refcnt
  664. );
  665. STDAPI_(void) OleDbgPrintRefCntAlways(
  666.         char*       lpszPrefix,
  667.         char*       lpszMsg,
  668.         void*      lpObj,
  669.         unsigned long       refcnt
  670. );
  671. STDAPI_(void) OleDbgPrintRect(
  672.         int         nDbgLvl,
  673.         char*       lpszPrefix,
  674.         char*       lpszMsg,
  675.         Rect*      lpRect
  676. );
  677. STDAPI_(void) OleDbgPrintRectAlways(
  678.         char*       lpszPrefix,
  679.         char*       lpszMsg,
  680.         Rect*      lpRect
  681. );
  682. STDAPI_(void) OleDbgPrintScodeAlways(char* lpszPrefix, char* lpszMsg, SCODE sc);
  683.  
  684.  
  685.  
  686. STDAPI OleStdGetInplaceClipRgn(RgnHandle rgn);
  687. // gets the union of all window structure rgns in the inplace server.
  688. // pass in a previously allocated rgn handle.  Overwrites its contents
  689.  
  690. STDAPI OleStdBlastWindows(RgnHandle rgn);
  691. // walks entire window list removing any part of a window that overlaps w/
  692. // the input rgn
  693.  
  694. STDAPI OleStdBlastWindow(WindowPtr window, RgnHandle rgn);
  695. //same as above, but only does one window
  696.  
  697. STDAPI OleStdUnblastWindows(RgnHandle rgn);
  698. // walks entire window list calling each window's WDEF to
  699. // recalc rgns. This ensures that window's struc/cont rgns
  700. // are in a consistent and correct state.
  701. // if rgn is non-null (in the case that the container is to remain in the
  702. // foreground, then this api causes an update event for that area (PaintOne)
  703.  
  704. STDAPI OleStdTranslateAccelerator(
  705.         LPOLEINPLACEFRAME lpFrame,
  706.         LPOLEINPLACEFRAMEINFO lpFrameInfo,
  707.         EventRecord * lpEvent);
  708.  
  709.  
  710. #endif // _OLESTD_H_
  711.